package com.intelligent.ispc.core.service;

import com.intelligent.ispc.core.dto.ExportFileDto;
import com.intelligent.ispc.utils.ExportFileStatus;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

/**
 * Created by Peter on 15/11/23.
 */
public interface ExportFileService {
    /**
     * Create a export file record.
     *
     * @param exportFileDto
     */
    Long createExportFile(ExportFileDto exportFileDto);

    /**
     * Delete export file record.
     *
     * @param id
     */
    void deleteExportFile(Long id);

    /**
     * Update the export status.
     * FINISHED or EXPORTING
     * @param id
     * @param status
     */
    void updateExportFileStatus(Long id, ExportFileStatus status);

    /**
     * Searching export file's detail by provided parameters.
     *
     * @param searchParams
     * @return the list of file dto.
     */
    List<ExportFileDto> searchFile(Map<String, Object> searchParams);


    /**
     * Searching export file's detail by provided parameters with pageable data.
     *
     * @param searchParams
     * @param pageRequest
     * @return the page object for file dto.
     */
    Page<ExportFileDto> searchFile(Map<String, Object> searchParams, Pageable pageRequest);

}
